package learn.basics.inherit;

class Fu {
    int num_fu_ = 10;
    int num_ = 100;

    public void method_fu() {
        System.out.println(num_);
    }


}

class Zi extends Fu {
    int num_zi_ = 20;
    int num_ = 200;

    public void method_zi() {
        System.out.println(num_);
    }

    public void method_zi_1(){
        int num=30;
        System.out.println(num);//30 局部变量
        System.out.println(this.num_);
        System.out.println(super.num_);
    }
}


class Demo01ExtendsField {
    public static void Test() {
        Fu fu = new Fu();
        System.out.println(fu.num_fu_);
        System.out.println("====================");

        Zi zi = new Zi();
        System.out.println(zi.num_fu_);
        System.out.println(zi.num_zi_);

        System.out.println("====================");
        System.out.println(zi.num_);
        System.out.println("===================");

        zi.method_zi();
        zi.method_fu();

    }
}

class Demo2Expends{
    public static void Test(){
        Zi zi=new Zi();
        zi.method_zi_1();
    }
}


public class TestInherit {
    public static void main(String[] args) {

        //Demo01ExtendsField.Test();
        Demo2Expends.Test();

    }
}
